<?php
//作者千柒qq743395324
namespace Admin\Controller;
use Think\Controller;
class LoginController extends Controller
{
    public function sned()
    {
		$janeuser    =   I('post.user','','htmlspecialchars'); 
		$janepass    =   I('post.pass','','htmlspecialchars'); 
		if(IS_AJAX){
			if(!$janeuser){
				exit('用户名不得为空');
			}
			if(!$janepass){
				exit('密码不得为空');
			}
			if($jane = M('jane')->where(array('username'=>$janeuser,'password'=>md5($janepass)))->find()){
					echo '登陆成功';
					session('username',$janeuser);
			}else{
				echo '账号或密码错误';
			}
		}else{
			echo '非法登录的渠道或方式';
		}
    }
	
	public function out()
    {
		session(null);
		redirect('/Admin/Login');
    }
}